﻿@using QqhrCitizen.Models
@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    Course course = ViewBag.Course as Course;
    ViewBag.Title = course.Title;
}

<div>
    <div class="result-title">
        <h1 class="head-tietle">@course.Title - 课程修改</h1>
    </div>
    @using (Html.BeginForm("CoursesEdit", "Admin", FormMethod.Post))
    {
        @Html.AntiForgerySID()
        <input value="@course.ID" type="hidden" name="ID" />
        <table class="detail-table">
            <tr>
                <td class="row-title">一级分类</td>
                <td>
                    <select name="oneType" class="textbox w-0-8" id="lsOneType">
                        <option value="0">选择分类</option>
                        @foreach (var item in ViewBag.Types)
                        {
                            <option value="@item.ID" @(course.TypeDictionary.FatherID == item.ID ? "selected" : "")>@item.TypeValue</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="row-title">二级分类</td>
                <td>
                    <select name="CourseTypeID" class="textbox w-0-8" id="lsSecondType">
                        @foreach (var item in ViewBag.Second)
                        {
                            <option value="@item.ID" @(course.TypeDictionary.ID == item.ID ? "selected" : "")>@item.TypeValue</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="row-title">优先级</td>
                <td>
                    <input class="textbox w-3" name="Priority" value="@course.Priority" />
                </td>
            </tr>
            <tr>
                <td class="row-title">标题</td>
                <td>
                    <input class="textbox w-3" name="Title" value="@course.Title" />
                </td>
            </tr>
            <tr>
                <td class="row-title">
                    描述
                </td>
                <td>
                    <textarea class="textbox  w-3" style="height:100px;" name="Description">@course.Description</textarea>
                </td>
            </tr>

        </table>

        <p><input type="submit" value="保存" class="button blue" /></p>
    }
</div>
